import request from "@/utils/request.ts";
import {ResponseType} from "@/types/common";
import {UserLoginRes, UserInfoRes} from "@/types/response/user";

// 登录
export function loginAPI(data: any): Promise<ResponseType<UserLoginRes>> {
    return request.post("/user/login", data);
}

// 获取用户信息
export function getInfoAPI(): Promise<ResponseType<UserInfoRes>> {
    return request.get("/user/info");
}

// 退出登录
export function logoutAPI(): Promise<ResponseType<any>> {
    return request.post("/user/logout");
}